﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Sustainalytics.LongRunningTaskManager.Tests
{
    [TestClass]
    public class LongRunningTaskManagerSettingsTests
    {
        [TestMethod]
        public void Instance()
        {
            LongRunningTaskManagerSettings settings = new LongRunningTaskManagerSettings();
            settings.MaxOverallManagedTasks = 99;
            settings.MaxTasksPerUser = 9;

            Assert.IsTrue(settings.MaxOverallManagedTasks == 99, "MaxOverallManagedTasks does not have the expected value.");
            Assert.IsTrue(settings.MaxTasksPerUser == 9, "MaxTasksPerUser does not have the expected value.");
        }

        [TestMethod]
        public void FromConfig()
        {
            LongRunningTaskManagerSettings settings = LongRunningTaskManagerSettings.FromConfig();

            Assert.IsTrue(settings.MaxOverallManagedTasks == 10, "MaxOverallManagedTasks does not have the expected value.");
            Assert.IsTrue(settings.MaxTasksPerUser == 3, "MaxTasksPerUser does not have the expected value.");
        }
    }
}
